const { BaseController } = require('../Base')

class Login extends BaseController {
    constructor() {
        super()
        this.exDb = this.dbBase.collection('user_list');
    }
    // 获取登录环境信息
    getctx() {
      const { ENV, OPENID, APPID } = this.cloud.getWXContext()
      return { ENV, OPENID, APPID }
    }
    // 用户信息
    async getUserInfo() {
      var result = await this.exDb.where({
        _openid: this.getOpenid()
      }).get()
      return this.resSuccess(result)
    }
}

const ex = new Login
module.exports = ex